package ioperation;

import book.BookList;

import java.util.Scanner;

public class FindBook implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("输入你要查找的图书: ");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        for (int i = 0; i < bookList.getUsedSize(); i++) {
            if(bookList.books[i].getName().equals(name)) {
                System.out.println(bookList.books[i].toString());
                return;
            }
        }
        System.out.println("没有你要找的图书...");
    }
}
